#include <opencv2/core/types.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <stdio.h>
#include <opencv2/opencv.hpp>

#include "opencv_helper.hpp"

int main()
{
    const int w = 500;
    const int h = 500;
    cv::Size size(w, h);
    cv::Mat image(size, CV_8UC3);
    cv::Scalar background_color(255, 255, 255);
    image = background_color;
    cv::Scalar line_color(0);
    const int thickness = 2;
    cv::Point center(w / 2, h / 2);
    for (int i = 3; i <= 50; i++)
    {
        image = background_color; // clear content
        std::vector<cv::Point> points = och::get_regular_polygon_vertices(size, i);
        cv::polylines(image, points, true, line_color, thickness);

        std::string text = std::to_string(i);
        int fontFace = cv::FONT_HERSHEY_SIMPLEX;
        double fontScale = 2.0;
        cv::Scalar fontColor(0);
        float offset_x = (i >= 10) ? 4.0 : 2.5;
        float offset_y = -2;
        cv::Point org = center - cv::Point(offset_x, offset_y) * 10;
        cv::putText(image, text, org, fontFace, fontScale, fontColor);

        cv::imshow("image", image);
        cv::waitKey(200);
    }

    return 0;
}

